﻿using FluentNHibernate.Mapping;
using WFC.BL.DomainModels;

namespace WFC.BL.Mappings
{
    public class UserMap : ClassMap<User>
    {

        public UserMap()
        {
            Id(m => m.Id);
            Map(m => m.CreatedBy);
            Map(m => m.CreateDttm);
            Map(m => m.EmailAddress);
            Map(m => m.IsAuthenticated);
            Map(m => m.Name);
            HasMany(m => m.Groups)
                .Cascade.All()
                .Inverse()
                .Table("UserGroups");
        }

    }
}
